package com.xnyzc.lhy.common.penum.cms.order.app;

/**
 * @Description 统计日期类型
 * @Author zhuyubin
 * @Date 2019-09-16 10:30
 **/
public enum ECountDayType {

    month(0, "当月"),
    threeMonths(1, "近三个月"),
    year(2, "当年");

    private Integer value;
    private String desc;

    ECountDayType(Integer value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public static ECountDayType findByValue(Integer value) {
        ECountDayType eCountDayType;
        switch (value) {
            case 0:
                eCountDayType = ECountDayType.month;
                break;
            case 1:
                eCountDayType = ECountDayType.threeMonths;
                break;
            case 2:
                eCountDayType = ECountDayType.year;
                break;
            default:
                throw new IllegalArgumentException("非法类型");
        }
        return eCountDayType;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
